#region Usings
using System;
using System.Linq;

using BK.Model;
using BK.Repositories.Abstract;
#endregion

namespace BK.Repositories.EF
{
    public class ImportStatusesRepository : BaseRepository<ImportStatus>, IImportStatusesRepository
    {
        #region IImportStatusesRepository Members
        public ImportStatusesRepository(BkDataContext dataContext) : base(dataContext)
        {
        }

        public ImportStatus GetBy(ImportStatuses importStatus)
        {
            string importStatusName = importStatus.ToString();
            ImportStatus result = (from impSt in ObjectSet.OfType<ImportStatus>() 
                                   where impSt.Name == importStatusName 
                                   select impSt).FirstOrDefault();

            return result;
        }
        #endregion
    }
}